import validator from "./validater";
const regular = {
  dicCode: [ //字典code
    {
      required: true,
      message: "此项为必填项",
      trigger: "blur"
    },
    {
      max: 100,
      message: "最大长度100个字符",
      trigger: "blur"
    }
  ],
  dicName: [//字典Name
    {
      required: true,
      message: "此项为必填项",
      trigger: "blur"
    },
    {
      max: 20,
      message: "最大长度20个字符",
      trigger: "blur"
    }
  ],
  notMob: [{
    validator: validator.telPhone,
    trigger: "blur"
  }],
  require1: [{
    required: true,
    message: "此项为必填项",
    trigger: "blur"
  }],
  require2: [{ //非必填长度校验
    max: 20,
    message: "最大长度20个字符",
    trigger: "blur"
  }],
  requireChange: [{
    required: true,
    message: "此项为必填项",
    trigger: 'change'
  }],
  require: [{
    required: true,
    message: "此项为必填项",
    trigger: "blur"
  }, {
    max: 20,
    message: "最大长度20个字符",
    trigger: "blur"
  }],
    require30: [{
    required: true,
    message: "此项为必填项",
    trigger: "blur"
  }, {
    max: 30,
    message: "最大长度30个字符",
    trigger: "blur"
  }],
  sort: [ //排序
    {
      required: true,
      message: "此项为必填项",
      trigger: "blur"
    },
    {
      validator: validator.Number,
      trigger: "blur"
    }
  ],
  sort1: [ //排序非必填
    {
      validator: validator.Number,
      trigger: "blur"
    }
  ],
  number: [{
    validator: validator.Number,
    trigger: "blur"
  }],
  userCode: [{
    //用户编号
    required: true,
    message: "请输入用户编号",
    trigger: "blur"
  },
  {
    max: 20,
    message: "最大长度20个字符",
    trigger: "blur"
  }
  ],
  userName: [{
    //用户名称
    required: true,
    message: "请输入用户名称",
    trigger: "blur"
  }, {
    max: 20,
    message: "最大长度20个字符",
    trigger: "blur"
  }],
  jobNumber: [{
    //用户工号
    required: true,
    message: "请输入工号",
    trigger: "blur"
  }, {
    max: 20,
    message: "最大长度20个字符",
    trigger: "blur"
  }],
  email: [{
    //邮箱
    required: true,
    message: "请输入邮箱",
    trigger: "blur"
  },
  {
    validator: validator.emailValue,
    trigger: "blur"
  }
  ],
  email1: [
    //邮箱非必填有校验
    {
      validator: validator.emailValue,
      trigger: "blur"
    }
  ],
  phone: [
    //手机号码验证
    {
      required: true,
      message: "此项为必填项",
      trigger: "blur"
    },
    {
      validator: validator.phoneNumber,
      trigger: "blur"
    }
  ],
  telPhone: {
    validator: validator.telPhone,
    trigger: "blur"
  },
  identity: [
    //身份证号码验证
    // {
    //   required: true,
    //   message: "此项为必填项",
    //   trigger: "blur"
    // },
    {
      validator: validator.idCard,
      trigger: "blur"
    }
  ],
  require50: [{
    required: true,
    message: "此项为必填项",
    trigger: "blur"
  }, {
    max: 50,
    message: "最大长度50个字符",
    trigger: "blur"
  }],
  sale: [{
    validator: validator.sale,
    trigger: "blur"
  }],
  fax: [{
    validator: validator.fax,
    trigger: "blur"
  }],
  internet: [{
    validator: validator.internet,
    trigger: "blur"
  }],
  postcode: [{
    validator: validator.postcode,
    trigger: "blur"
  }],
  positive: [{
    required: true,
    message: "此项为必填项",
    trigger: "blur"
  }, {
    validator: validator.positive,
    trigger: "blur"
  }],
  positive1: [{
    validator: validator.positive,
    trigger: "blur"
  }]
};
export default regular;
